package com.niiwoo.civet.trade.configuration;

import com.niiwoo.civet.trade.constant.RabbitConstant;
import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ProjectLifeCycleConfigurataion {
    @Bean
    public Exchange ProjectLifeExchange() {
        return new DirectExchange(RabbitConstant.Exchange.PROJECT_LIFE_CYCLE, true, true);
    }

    @Bean
    public Queue ProjectLifeQueue() {
        return new Queue(RabbitConstant.Queue.PROJECT_LIFE_CYCLE, true);
    }

    @Bean
    public Binding kaolaCreditAssignmentContractBinding() {
        return BindingBuilder.bind(ProjectLifeQueue())
                .to(ProjectLifeExchange())
                .with(RabbitConstant.RoutingKey.PROJECT_LIFE_CYCLE).noargs();
    }
}
